<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        
        <h:commandButton value="Print">
            <p:printer target="output" />
        </h:commandButton>
        <h:outputText id="output" value="PrimeFaces Rocks!" />
        
        <p />
        
        <p:commandButton value="Print Image 1" type="button" icon="ui-icon-print" style="display:block;margin-bottom: 20px">
            <p:printer target="image1" />
        </p:commandButton>
        <p:graphicImage id="image1" value="/IMG/photo1.jpg" />
        
        <p />
        
        <p:commandLink value="Print Image 2">
            <p:printer target="image2" />
        </p:commandLink>
        <p:graphicImage id="image2" value="/IMG/photo4.jpg" />
        
    </h:body>
</html>
